package com.relytosoft.mizar.media.alarm.api.pojo.dto;

import com.relytosoft.mizar.media.alarm.api.entity.Alarm;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author wss
 * @version 1.0
 * @date 2022/5/23 14:43
 */
@ApiModel("布控报警dto")
public class AyControlAlarmDto implements Serializable {

    @ApiModelProperty(value = "报警类型", required = true)
    private Integer alarmTypeId;

    /**
     * 报警源设备ID
     */
    @ApiModelProperty(value = "报警源设备ID")
    private String cameraId;

    /**
     * 报警源设备编码
     */
    @ApiModelProperty(value = "报警源设备编码")
    private String cameraCode;

    /**
     * 报警源设备名称
     */
    @ApiModelProperty(value = "报警源设备名称")
    private String cameraName;

    /**
     * 布控设防任务ID
     */
    @ApiModelProperty(value = "布控设防任务ID")
    private String taskId;

    /**
     * 布控设防任务名称
     */
    @ApiModelProperty(value = "布控设防任务名称")
    private String taskName;

    /**
     * 报警图片地址
     */
    @ApiModelProperty(value = "报警图片地址")
    private String alarmImg;

    /**
     * 报警时间
     */
    @ApiModelProperty(value = "报警时间")
    private LocalDateTime alarmTime;

    /**
     * 报警描述
     */
    @ApiModelProperty(value = "报警描述")
    private String remark;

    public static Alarm buildAlarm(AyControlAlarmDto dto) {
        Alarm alarm = new Alarm();
        alarm.setAlarmImg(dto.getAlarmImg());
        alarm.setRemark(dto.getRemark());
        alarm.setTaskId(dto.getTaskId());
        alarm.setCameraId(dto.getCameraId());
        alarm.setAlarmTypeId(dto.getAlarmTypeId());
        alarm.setAlarmTime(dto.getAlarmTime());
        return alarm;
    }

    public Integer getAlarmTypeId() {
        return alarmTypeId;
    }

    public void setAlarmTypeId(Integer alarmTypeId) {
        this.alarmTypeId = alarmTypeId;
    }

    public String getCameraId() {
        return cameraId;
    }

    public void setCameraId(String cameraId) {
        this.cameraId = cameraId;
    }

    public String getCameraCode() {
        return cameraCode;
    }

    public void setCameraCode(String cameraCode) {
        this.cameraCode = cameraCode;
    }

    public String getCameraName() {
        return cameraName;
    }

    public void setCameraName(String cameraName) {
        this.cameraName = cameraName;
    }

    public String getTaskId() {
        return taskId;
    }

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public String getAlarmImg() {
        return alarmImg;
    }

    public void setAlarmImg(String alarmImg) {
        this.alarmImg = alarmImg;
    }

    public LocalDateTime getAlarmTime() {
        return alarmTime;
    }

    public void setAlarmTime(LocalDateTime alarmTime) {
        this.alarmTime = alarmTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public String toString() {
        return "AyControlAlarmDto{" +
                "alarmTypeId=" + alarmTypeId +
                ", cameraId='" + cameraId + '\'' +
                ", cameraCode='" + cameraCode + '\'' +
                ", cameraName='" + cameraName + '\'' +
                ", taskId='" + taskId + '\'' +
                ", taskName='" + taskName + '\'' +
                ", alarmImg='" + alarmImg + '\'' +
                ", alarmTime=" + alarmTime +
                ", remark='" + remark + '\'' +
                '}';
    }
}
